#include "Console.h"

#include <Rz/IO/ConsoleStream.h>

namespace Rz { namespace Console {

IO::ConsoleStream _consoleStream;

void Write(const TCHAR* format, ...)
{
	va_list argList;

	va_start(argList, format);

	String result = String::FormatV(format, argList);

	va_end(argList);

	_consoleStream.Write(reinterpret_cast<const byte_t*>(result.GetCharArray()), result.GetLength());
}

void WriteLine(const TCHAR* format, ...)
{
	va_list argList;

	va_start(argList, format);

	String result = String::FormatV(format, argList);

	va_end(argList);

	_consoleStream.WriteLine(result);
}

byte_t ReadKey()
{
	return _consoleStream.ReadByte();
}

String ReadLine()
{
	return _consoleStream.ReadLine();
}

} }
